﻿using JHT.SimpleTaskSystem.EntityFramework;
using System;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JHT.SimpleTaskSystem.Migrations.SeedData
{
    public class DefaultPersonCreator
    {
        private readonly SimpleTaskSystemDbContext _context;

        public DefaultPersonCreator(SimpleTaskSystemDbContext context)
        {
            _context = context;
        }

        public void Create()
        {
            CreateEditions();
        }

        private void CreateEditions()
        {
            _context.Persons.AddOrUpdate(p => p.UserName,
                new Person() { UserName = "张鑫" },
                new Person() { UserName = "杨月志" },
                new Person() { UserName = "魏嘉" },
                new Person() { UserName = "陈斌" }
            );
        }
    }
}
